def is_duplicate(lst):
    counts = {}
    for item in lst:
        if item in counts:
            return True
        counts[item] = 1
    return False
lst = [1,2,3,4,5,1]
result = is_duplicate(lst)
print(result)
print(lst) # 原列表不会改变
